﻿namespace Modbus.Messages
{
	internal sealed class WriteSingleCoilMessage : ModbusMessage
	{
		private ushort outputAddress;
		private ushort outputValue;

		public override void Read(ModbusReader reader)
		{
			base.Read(reader);

			this.outputAddress = reader.ReadUInt16();
			this.outputValue = reader.ReadUInt16();
		}

		public override void Write(ModbusWriter writer)
		{
			base.Write(writer);

			writer.Write(this.outputAddress);
			writer.Write(this.outputValue);
		}

		public ushort OutputAddress
		{
			get { return this.outputAddress; }
			set { this.outputAddress = value; }
		}

		public ushort OutputValue
		{
			get { return this.outputValue; }
			set { this.outputValue = value; }
		}
	}
}
